package jok.thread;

public class SyncTicketThreadWithClassBlock implements Runnable {

	@Override
	public void run() {
		synchronized (SyncTicketThreadWithClassBlock.class) {
			System.out.println(Thread.currentThread().getName() + "：开始卖票");
			try {
				Thread.sleep(10);// 休眠10毫秒
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println(Thread.currentThread().getName() + "：结束卖票");
		}
	}

}
